import request from '@/utils/request.js';

/**
 * 获取作物生长记录分页列表
 * @param {Object} params 查询参数
 * @returns {Promise} 返回Promise对象
 */
export function getGrowthRecordsPage(params) {
  return request.get('/app-api/nongye/appGrowth-records/page', params);
}

/**
 * 获取作物生长记录详情
 * @param {number} id 记录ID
 * @returns {Promise} 返回Promise对象
 */
export function getGrowthRecordDetail(id) {
  return request.get('/app-api/nongye/appGrowth-records/get', { id });
}

/**
 * 创建作物生长记录
 * @param {Object} data 记录数据
 * @returns {Promise} 返回Promise对象
 */
export function createGrowthRecord(data) {
  return request.post('/app-api/nongye/appGrowth-records/create', data);
}

/**
 * 更新作物生长记录
 * @param {Object} data 记录数据
 * @returns {Promise} 返回Promise对象
 */
export function updateGrowthRecord(data) {
  return request.put('/app-api/nongye/appGrowth-records/update', data);
}

/**
 * 删除作物生长记录
 * @param {number} id 记录ID
 * @returns {Promise} 返回Promise对象
 */
export function deleteGrowthRecord(id) {
  return request.delete(`/app-api/nongye/appGrowth-records/delete?id=${id}`);
} 